﻿namespace Creek.UI.Effects
{
    using System;

    /// <summary>
    /// 	Manages transitions for int properties.
    /// </summary>
    internal class ManagedType_Int : IManagedType
    {
        #region Public Methods and Operators

        /// <summary>
        /// 	Returns a copy of the int passed in.
        /// </summary>
        public object copy(object o)
        {
            var value = (int)o;
            return value;
        }

        /// <summary>
        /// 	Returns the value between the start and end for the percentage passed in.
        /// </summary>
        public object getIntermediateValue(object start, object end, double dPercentage)
        {
            var iStart = (int)start;
            var iEnd = (int)end;
            return Utility.interpolate(iStart, iEnd, dPercentage);
        }

        /// <summary>
        /// 	Returns the type we are managing.
        /// </summary>
        public Type getManagedType()
        {
            return typeof(int);
        }

        #endregion
    }
}